{extend name='public/content'}

{block name="title"}
	登录页面
{/block}

{block name="body"}
<div class="container">
		<form action="{:url('outlo/login')}" method="post">
			//电话
			<input type="text" name="tele">
			<br>
			//密码
			<input type="password" name="password">
			<br>
			记住密码
			<input type="checkbox" name="jishimima">
		<span class="btn btn-info" id="denglu">登录</span>
		</form>
		<div class="layui-container">  
		 	<div id="qrcode" style="width:500px; height:500px; margin-top:15px;"></div>
		</div>
		<a href="{:url('outlo/register')}">注册账号</a>
</div>
{/block}

{block name="script"}
<script type="text/javascript">
 		require(['jquery','qrcode',"jquery.cookies"], function () {
 			// $("input[name=tele]").val($.cookie('tele'));
 			// $("input[name=password]").val($.cookie('password'));
 			//	console.log($.cookie('tele')+'-------------'+$.cookie('password'));
 			$('#denglu').click(function(){
 				if($('input[name=jishimima]').is(':checked')){
 					$.cookie('tele', $("input[name=tele]").val(), { expires: 100 });
 					$.cookie('password', $("input[name=password]").val(), { expires: 100 });
 					alert("yijin jizhu mima ");
 				}else{
 					$.cookie('tele',null);
 					$.cookie('password',null);
 				}
 				$("form").submit();
 			})

			var qrcode = new QRCode(document.getElementById("qrcode"), {
					width : 400,
					height : 400
				});

				function makeCode () {							
					qrcode.makeCode("{$uid}");
				}
				//makeCode();
				// setInterval(function(){
				//     getMsgNum();
				// },5000);

				function getMsgNum(){
				    $.ajax({
				        url:'{:url("outlo/logobysc")}?uid={$uid}',
				        type:'POST',
				        dataType:'json',
				        success:function(data){
				        	if(data.status==1){
				        		//window.location.href="{:url('index/index/index')}";
				        	}
				            console.log(data);
				        }
				    });
				}
 		})
 </script>
{/block}

{block name="style"}
 <style type="text/css">
 	
 </style>
{/block}